# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Alois Nespor <alium@centrum.cz>
# Contributor: kikadf <kikadf.01@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: thacrazze <thacrazze|googlemail|com>

pkgname=clipgrab
pkgver=3.9.7
pkgrel=2
pkgdesc='A video downloader and converter for YouTube, Veoh, DailyMotion, MyVideo, ...'
arch=(loong64 x86_64)
url='https://clipgrab.org'
license=(GPL3)
depends=(qt5-webengine yt-dlp)
optdepends=('ffmpeg: for the conversion functionality')
source=(https://download.clipgrab.org/$pkgname-$pkgver.tar.gz
        $pkgname.desktop)
sha256sums=('f47f2b68977a332c8520263c59465018b278b5e28f2548907ea6eed47580548c'
            '840910097d8c129ea12c395c4a33f562591e878e521c98fde8a7b3f9403aa23f')

build() {
  cd $pkgname-$pkgver

  qmake-qt5 clipgrab.pro
  make
}

package() {
  cd $pkgname-$pkgver
  install -Dm755 $pkgname -t "$pkgdir"/usr/bin/
  install -Dm644 icon.png "$pkgdir/usr/share/pixmaps/$pkgname.png"
  install -Dm644 "$srcdir"/$pkgname.desktop -t "$pkgdir"/usr/share/applications/
}
